<template>
  <h1>EL-单选组件</h1>
  <el-radio-group v-model="edu">
<!--    子标签的value属性值 会传递到父级标签的 edu中 -->
<!--      <el-radio value="初中">学历:初中</el-radio>-->
<!--      <el-radio value="高中">学历:高中</el-radio>-->
<!--      <el-radio value="本科">学历:本科</el-radio>-->
<!--      <el-radio value="硕士">学历:硕士</el-radio>-->

<!--    label 属性值相当于HTML 中的 innerHTML方法  -->
    <el-radio value="11" label="学历:初中"></el-radio>
    <el-radio value="22" label="学历:高中"></el-radio>
    <el-radio value="33" label="学历:本科"></el-radio>
    <el-radio value="44" label="学历:硕士"></el-radio>
  </el-radio-group>
  <h4>您的选项是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="pr">
<!--    :[属性值]="p.price" 单项绑定,适合给指定[属性值] 赋值  -->
    <el-radio-button v-for="p in arr" :value="p.price" >{{p.title}}</el-radio-button>
  </el-radio-group>
  <h4 >这款酒的价格:{{pr}}</h4>

</template>


<script setup>
import {ref} from "vue";

const edu = ref('22');

const pr = ref(330);
const arr = ref([
  {title:'五粮液',price:500},
  {title:'茅台',price:2500},
  {title:'汾酒',price:330},
  {title:'梦之蓝',price:368}
])
</script>

<style scoped>

</style>